package com.his.registration.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @BelongsProject: workspace-idea
 * @BelongsPackage: com.his.registration.mapper
 * @Author: ZhangYing
 * @Date: 2023/7/7 13:30
 * @Description:
 */
@Mapper
public interface UserMapper {
    //查询用户
    public int verify(String username,String password);

    //注册
    @Insert("insert into user values(#{username},#{password})")
    public int insert(String username,String password);

    //修改密码
    @Update("update user set password=#{password} where username=#{username}")
    public int update(String username,String password);

    //根据用户名来搜索
    @Select("SELECT COUNT(*) AS result FROM user WHERE username=#{username}")
    public int selectByUsername(String username);
}
